﻿#include <iostream>
#include <string>
using namespace std;
class info
{
protected:
	int id;
	string name;
public:
	info(int i = 1, string n = "adr") { id = i, name = n; }
	void show() { cout << "id: " << id << " name: " << name << endl; }
	//virtual void show() { cout << "id: " << id << " name: " << name << endl; }
};
class Teacher:virtual public info
{
protected:
	int workHour;
	static int tcNum;
public:
	Teacher(int,string);//int Hour, string name
	virtual double CalcuSalary() { return this->workHour > 160 ? 4500 : this->workHour * 50; }//超过20天*8h给月工资4500 低与160就按小时计算
	void show() { cout << "id: " << id << " name: " << name << " workHour: " << workHour << " Salary :" << CalcuSalary() << endl; }
	virtual~Teacher() {};
};
class Student :virtual public info
{
protected:
	int courseNum, studyHours;
	static int stuNum;
public:
	Student(int ,int ,string);//int cNum, int sHours,string name
	void show() { cout << "id: " << id << " name: " << name  << " CourseNum: " << courseNum << " StudyHours: " << studyHours << endl; }

	virtual~Student() {};
};
class TcAssist :public Teacher, public Student
{
private:
	static int assisNum;
public:
	TcAssist(int cHour, int sHour, int wHour, string name) :info(assisNum, name) , Teacher(wHour, name) , Student(cHour, sHour, name) {}
	double CalcuSalary() { return this->workHour * 35.0; }
	void show() { cout << "id: " << id << " name: " << name << " workHour: " << workHour << " Salary :" << CalcuSalary() << " CourseNum: " << courseNum << " StudyHours: " << studyHours << endl; }
	~TcAssist() {};
};
int Student::stuNum = 1;
int Teacher::tcNum = 1;
int TcAssist::assisNum = 1;
Teacher::Teacher(int Hour, string name) :info(tcNum, name)
{
	this->workHour = Hour;
	this->tcNum++;
}
Student::Student(int cNum, int sHours,string name) : info(stuNum, name)
{
	this->courseNum = cNum;
	this->studyHours = sHours;
	stuNum++;
}
int main()
{
	info i1;
	i1.show();
	Teacher t1(200, "ADR");
	t1.show();
	Student s1(10, 200, "adrr");
	s1.show();
	TcAssist ta1(10, 200, 200, "Adr");
	ta1.show();
}